home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / dev / src / wangisrc.lha / wangi / z / DefDTIcon / DefDTIcon.PAS < prev    next >
Pascal/Delphi Source File  |  1996-10-26  |  3KB  |  121 lines

  1. Program DefIconer;
  2.  
  3. {************* $F-,I-,R-,S-,V-,M 2,1,1,15}
  4. {***** $F-,I+,R+,S+,V+,M 2,1,1,15}
  5.  
  6.  
  7. USES
  8.     Exec, Intuition, Commodities, Icon, 
  9.     Workbench, DataTypes, DOS, Amiga, 
  10.     AmigaDOS, IFFParse, DataTypesClass;
  11.  
  12. TYPE
  13.     tProgVars = Record
  14.         TEXT,
  15.         ICONDIR     : String[80];
  16.         COARSE, 
  17.         NODATATYPE, 
  18.         NOTOOLWIN, 
  19.         DEFAULTTOOL,
  20.         NOTOOL      : Boolean;
  21.     End; {tProgVars}
  22.     
  23.     pStrNode = ^tStrNode;
  24.     tStrNode = record
  25.         sn_node : tNode;
  26.         sn_Name : String;
  27.         sn_Lock : BPTR;
  28.     end;
  29.     
  30. CONST        
  31.     RKey : pRemember = NIL;
  32.     Version : String[31] = '$VER: DefDTIcon 1.6 (05.11.94)'#0;
  33.     
  34. VAR
  35.     V : tProgVars;
  36.         
  37. function CStrConstPtrAR(rk : ppRemember; s : String) : STRPTR;
  38.  
  39. var  p : STRPTR;
  40. begin
  41.   s := s + #0;                                    { Make "C" string }
  42.   p := AllocRemember(rk, length(s), MEMF_CLEAR);  { Get some mem for it }
  43.   move(s[1], p^, length(s));                      { Move s into newly alloc'd mem }
  44.   CStrConstPtrAR := STRPTR(p);                    { Return the pointer }
  45. end;
  46.                             
  47. {$I ToolType.PAS}
  48. {$I IDPort.PAS}
  49. {$I ProcessMsg.PAS}
  50. {$I AppMenu.PAS}
  51.  
  52.  
  53.  
  54. Procedure Main;
  55.  
  56.  
  57.  
  58. VAR
  59.     IDPort, AppPort : pMsgPort;
  60.     AppMenu : pAppMenuItem;
  61.     n : LONG;
  62.     ez : pEasyStruct;
  63.     
  64. CONST
  65.     portname : String[13] = 'DDTI_ID_PORT'#0;
  66.     
  67. Begin
  68.     IntuitionBase := pIntuitionBase(OpenLibrary('intuition.library',0));
  69.     If IntuitionBase <> NIL then begin
  70.         IconBase := OpenLibrary('icon.library',37);
  71.         If IconBase <> NIL then begin
  72.             WorkBenchBase := OpenLibrary('workbench.library',37);
  73.             If WorkbenchBase <> NIL then begin
  74.                 IFFParseBase := OpenLibrary('iffparse.library',36);
  75.                 if IFFParseBase <> NIL then begin
  76.                     DataTypesBase := OpenLibrary('datatypes.library',39);
  77.                 
  78.                     if CheckIDPortOrSetup(IDPort, @portname[1]) then begin
  79.                         GetToolTypes(V);
  80.                         IF InitAppICons(V, AppPort, AppMenu) then begin
  81.                             ProcessMessage(IDPort, AppPort);
  82.                             
  83.                             ez := AllocRemember(@RKey, Sizeof(tEasyStruct), MEMF_CLEAR);
  84.                             if ez <> NIL then begin
  85.                                 With ez^ do begin
  86.                                     es_StructSize :=  Sizeof(tEasyStruct);
  87.                                     es_Title := CStrConstPtrAR(@RKey, 'DefDTIcon Quitting');
  88.                                     es_TextFormat := CStrConstPtrAR(@RKey, 'DefDTIcon Copyright ©Lee Kindness.'#10+
  89.                                                                            'Trying to bring some conformity to all those gastly icons :-)'#10+
  90.                                                                            ''#10+
  91.                                                                            'Comments to:'#10+
  92.                                                                            ' Lee Kindness'#10+
  93.                                                                            ' 8 Craigmarn Road'#10+
  94.                                                                            ' Portlethen Village'#10+
  95.                                                                            ' Aberdeen AB1 4QR'#10+
  96.                                                                            ' SCOTLAND');
  97.                                     es_GadgetFormat := CStrConstPtrAR(@RKey, 'Quit');
  98.                                     n := EasyRequestArgs(NIL, ez, NIL, NIL);
  99.                                 End;
  100.                             End;
  101.                             CleanAppMenu(AppPort,AppMenu);
  102.                         end;
  103.                         CleanIDPort(IDPort);
  104.                     end;
  105.                     
  106.                     CloseLibrary(pLibrary(DataTypesBase));
  107.                     CloseLibrary(pLibrary(IFFParseBase));
  108.                 end;
  109.                 CloseLibrary(pLibrary(WorkBenchBase));
  110.             End;
  111.             CloseLibrary(pLibrary(IconBase));
  112.         End;
  113.         FreeRemember(@RKey, True);
  114.         CloseLibrary(pLibrary(IntuitionBase));
  115.     End;
  116. End;
  117.  
  118. Begin
  119. Main;
  120. End.
  121.